package com.kexin.coupon.timer;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
 * 定时任务配置参数
 * @author ao
 */
@Configuration
public class TimerConfig {

	/** 每日0时后的定时任务执行时间 **/
	@Value("${timer.everyday}")
	private String everyday;

	/** 每日24时前的定时任务执行时间 **/
	@Value("${timer.everydayFront}")
	private String everydayFront;

	/** 每小时的定时任务执行时间 **/
	@Value("${timer.everyHour}")
	private String everyHour;

	private static TimerConfig timerConfig;

	@PostConstruct
	public void init() {
		timerConfig = this;
		timerConfig.everyday = everyday;
		timerConfig.everydayFront = everydayFront;
		timerConfig.everyHour = everyHour;
	}

	public static String getEveryday() {
		return timerConfig.everyday;
	}

	public static String getEverydayFront() {
		return timerConfig.everydayFront;
	}

	public static String getEveryHour() {
		return timerConfig.everyHour;
	}
}
